<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <link rel="stylesheet" href="styles/style.css">
        <link rel="stylesheet" href="styles/theme/atom-one-dark.css">
        <title>例子4-JS进阶（二）</title>
    </head>
    <body>
        <pre>
            <code>
                    // 例子4

                    var a = 10;
                    var obj = {
                        a: 20
                    }

                    function fn () {
                        console.log(this);
                    }

                    console.log(this); // window
                    fn(); // window
                    fn.call(obj); // {a:20}
            </code>
        </pre>
        <script src="scripts/libs/highlight.pack.js"></script>
        <script src="scripts/4.js"></script>
        <script>
            hljs.initHighlightingOnLoad();
        </script>
    </body>
</html>